const enum EPlatform {
  H5 = "H5",
  App = "APP-PLUS",
  AppNVue = "APP-NVUE",
  MiniWeixin = "MP-WEIXIN",
  MiniAlipay = "MP-ALIPAY",
  MiniBaidu = "MP-BAIDU",
  MiniToutiao = "MP-TOUTIAO",
  MiniQQ = "MP-QQ",
}

function getPlatformId(): EPlatform {
  let platform: EPlatform;
  //#ifdef H5
  platform = EPlatform.H5;
  //#endif
  //#ifdef APP-PLUS
  platform = EPlatform.App;
  //#endif
  //#ifdef APP-NVUE || APP-PLUS-NVUE
  platform = EPlatform.AppNVue;
  //#endif
  //#ifdef MP-WEIXIN
  platform = EPlatform.MiniWeixin;
  //#endif
  //#ifdef MP-ALIPAY
  platform = EPlatform.MiniAlipay;
  //#endif
  //#ifdef MP-BAIDU
  platform = EPlatform.MiniBaidu;
  //#endif
  //#ifdef MP-TOUTIAO
  platform = EPlatform.MiniToutiao;
  //#endif
  //#ifdef MP-QQ
  platform = EPlatform.MiniQQ;
  //#endif
  return platform;
}

const platform: EPlatform = getPlatformId();
export { platform, EPlatform };
